//
//  Zone.m
//  homework-05
//
//  Created by Snow on 16/7/11.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "Zone.h"

@implementation Zone
//在实例方法中 self 代表实例对象(调用者)
- (instancetype)initWithName:(NSString *)name
{
    self = [super init];
    if (self) {
        _name = name;
    }
    return self;
}
+ (instancetype)zoneWithName:(NSString *)name
{
    //在类方法中 self 代表类本身
    return [[self alloc] initWithName:name];
}
//指派初始化
- (instancetype)initWithName:(NSString *)name number:(NSString *)number
{
    self = [super init];
    if (self) {
        _name = name;
        _number = number;
    }
    return self;
}

+ (instancetype)zoneWithName:(NSString *)name number:(NSString *)number
{
    return [[self alloc]initWithName:name number:number];
}
- (instancetype)initWithTempCity:(TempCity *)tempCity
{
    return [self initWithName:tempCity.cityName number:tempCity.cityNumber];
}
+ (instancetype)zoneWithTempCity:(TempCity *)tempCity
{
    return [[self alloc] initWithName:tempCity.cityName number:tempCity.cityNumber];
}
@end
